package com.ray.bean;

import com.ray.util.MathUtil;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class AttendanceMonthSummaryBean {
	private Integer userId;//用户id
	private String userName;//用户姓名
	private String groupName;//考勤组
	private String deptName;//部门
	private String method;//计薪方式
	private Long lateDuration;//迟到时长
	private Long earlyDuration;//早退时长
	private Long leaveDuration;//请假时长
	private Long effectiveDuration;//有效工作时长
	private Long overtimeDuration;//加班时长
	private Double attendanceSalary;//出勤工资
	private Double socialSecurity;//社保扣款
	private Double accumulationFund;//公积金扣款
	private Double otherDeduction;//其他扣款
	private Double otherAddition;//其他加项
	private Double realSalary;//实发薪水
	private Double electricFee;//电费
	private Double waterFee;//水费
	private Double pieceWage;//计件工资
	private Double applyRepairMoney;//补料扣款
	private Double administrativePenaltyForAward;//行政奖励
	private Double administrativePenaltyForPunish;//行政处罚
	
	public AttendanceMonthSummaryBean() {
		
	}
	
	public AttendanceMonthSummaryBean(Builder builder){
		this.userId = builder.userId;
		this.userName = builder.userName;
		this.groupName = builder.groupName;
		this.deptName = builder.deptName;
		this.lateDuration = builder.lateDuration;
		this.earlyDuration = builder.earlyDuration;
		this.leaveDuration = builder.leaveDuration;
		this.overtimeDuration = builder.overtimeDuration;
		this.effectiveDuration = builder.effectiveDuration;
		this.attendanceSalary = builder.attendanceSalary;
		this.socialSecurity = builder.socialSecurity;
		this.accumulationFund = builder.accumulationFund;
		this.otherDeduction = builder.otherDeduction;
		this.otherAddition = builder.otherAddition;
		this.realSalary = builder.realSalary;
		this.electricFee = builder.electricFee;
		this.waterFee = builder.waterFee;
		this.pieceWage = builder.pieceWage;
		this.applyRepairMoney = builder.applyRepairMoney;
		this.method = builder.method;
		this.administrativePenaltyForAward = builder.administrativePenaltyForAward;
		this.administrativePenaltyForPunish = builder.administrativePenaltyForPunish;
	}
	
	public static class Builder{
		private Integer userId;
		private String userName;
		private String groupName;//考勤组
		private String deptName;//部门
		private Long lateDuration;
		private Long earlyDuration;
		private Long leaveDuration;
		private Long overtimeDuration;
		private Long effectiveDuration;
		private Double attendanceSalary;
		private Double socialSecurity;//社保扣款
		private Double accumulationFund;//公积金扣款
		private Double otherDeduction;//其他扣款
		private Double otherAddition;//其他加项
		private Double realSalary;
		private Double electricFee;//电费
		private Double waterFee;//水费
		private Double pieceWage;//计件工资
		private Double applyRepairMoney;//补料扣款
		private String method;//计薪方式
		private Double administrativePenaltyForAward;//行政奖励
		private Double administrativePenaltyForPunish;//行政处罚
		
		public Builder userId(Integer userId) {
			this.userId = userId;
			return this;
		}
		public Builder userName(String userName) {
			this.userName = userName;
			return this;
		}
		public Builder groupName(String groupName) {
			this.groupName = groupName;
			return this;
		}
		public Builder deptName(String deptName) {
			this.deptName = deptName;
			return this;
		}
		public Builder lateDuration(Long lateDuration) {
			this.lateDuration = lateDuration;
			return this;
		}
		public Builder earlyDuration(Long earlyDuration) {
			this.earlyDuration = earlyDuration;
			return this;
		}
		public Builder leaveDuration(Long leaveDuration) {
			this.leaveDuration = leaveDuration;
			return this;
		}
		public Builder overtimeDuration(Long overtimeDuration) {
			this.overtimeDuration = overtimeDuration;
			return this;
		}
		public Builder effectiveDuration(Long effectiveDuration) {
			this.effectiveDuration = effectiveDuration;
			return this;
		}
		public Builder attendanceSalary(Double attendanceSalary) {
			this.attendanceSalary = attendanceSalary;
			return this;
		}
		public Builder socialSecurity(Double socialSecurity) {
			this.socialSecurity = socialSecurity;
			return this;
		}
		public Builder accumulationFund(Double accumulationFund) {
			this.accumulationFund = accumulationFund;
			return this;
		}
		public Builder otherDeduction(Double otherDeduction) {
			this.otherDeduction = otherDeduction;
			return this;
		}
		public Builder otherAddition(Double otherAddition) {
			this.otherAddition = otherAddition;
			return this;
		}
		public Builder realSalary(Double realSalary) {
			this.realSalary = MathUtil.doubleFormatRoundDown(realSalary < 0.0 ? 0 : realSalary, 2);
			return this;
		}
		public Builder electricFee(Double electricFee) {
			this.electricFee = electricFee;
			return this;
		}
		public Builder waterFee(Double waterFee) {
			this.waterFee = waterFee;
			return this;
		}
		public Builder pieceWage(Double pieceWage) {
			this.pieceWage = pieceWage;
			return this;
		}
		public Builder method(String method) {
			this.method = method;
			return this;
		}
		
		public Builder applyRepairMoney(Double applyRepairMoney) {
			this.applyRepairMoney = applyRepairMoney;
			return this;
		}
		
		public Builder administrativePenaltyForAward(Double administrativePenaltyForAward) {
			this.administrativePenaltyForAward = administrativePenaltyForAward;
			return this;
		}
		
		public Builder administrativePenaltyForPunish(Double administrativePenaltyForPunish) {
			this.administrativePenaltyForPunish = administrativePenaltyForPunish;
			return this;
		}
		
		
		
		public AttendanceMonthSummaryBean build() {
			return new AttendanceMonthSummaryBean(this);
		}
	}
	
}
